﻿<UserControl x:Class="Samba.Modules.BasicReports.BasicReportView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:BasicReports="clr-namespace:Samba.Modules.BasicReports" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="25*"/>
            <ColumnDefinition Width="75*"/>
        </Grid.ColumnDefinitions>

        <ItemsControl Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Reports}" Background="White">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button HorizontalAlignment="Stretch" Style="{StaticResource ItemsControlButtonStyle}"
                            CommandParameter="{Binding}"
                            Command="{Binding DataContext.ReportExecuteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}">
                        <Label Background="{Binding Background}" Foreground="{Binding Foreground}" HorizontalAlignment="Stretch" Content="{Binding Header}" FontSize="16" FontWeight="Bold"></Label>
                    </Button>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        <Grid Grid.Column="1" Visibility="{Binding IsReportVisible,Converter={StaticResource VisibilityConverter}}">
            <BasicReports:ReportView DataContext="{Binding ActiveReport}"/>
        </Grid>
            
    </Grid>
</UserControl>
